/**
 * Logger 日志控制工具类
 * 
 */
class Logger {
    public static isDebug: boolean = !!window.localStorage.getItem("isDebug");
    static setIsDebug(isDebug: boolean | undefined) {
        window.localStorage.setItem("isDebug", !!isDebug ? "1" : "");
        this.isDebug = !!isDebug;
    }
    static log(...message: any[]) {
        if (!Logger.isDebug) return;
        console.log("derucciSDK " + (new Date()).toLocaleString().split(" ")[1], ...JSON.parse(JSON.stringify(message)));
    }
    
}

export default Logger;
